package com.blackitheima2.LambdaDemo.test3;
//Lambda表达式 有参无返回值
public class TestFly {
    public static void main(String[] args) {
        //匿名内部类
        goFly(new Fly() {
            @Override
            public void toFly(String s) {
                System.out.println(s);
            }
        });
        //Lambda表达式
        goFly((s)-> System.out.println(s));


    }
    public static void goFly(Fly fly){
        fly.toFly("慢慢飞");
    }
}
//接口
interface Fly{
    public abstract void toFly(String s);
}
